[DEFAULT]

#
# From oslo.log
#

# If set to true, the logging level will be set to DEBUG instead of the default INFO level. (boolean value)
#debug = false
debug = {{ gnocchi_debug }}

# If set to false, the logging level will be set to WARNING instead of the default INFO level. (boolean value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
#verbose = true

# The name of a logging configuration file. This file is appended to any existing logging configuration files. For details about logging
# configuration files, see the Python logging module documentation. Note that when logging configuration files are used then all logging
# configuration is set in the configuration file and other logging configuration options are ignored (for example,
# logging_context_format_string). (string value)
# Deprecated group/name - [DEFAULT]/log_config
#log_config_append = <None>

# Defines the format string for %%(asctime)s in log records. Default: %(default)s . This option is ignored if log_config_append is set.
# (string value)
#log_date_format = %Y-%m-%d %H:%M:%S

# (Optional) Name of log file to send logging output to. If no default is set, logging will go to stderr as defined by use_stderr. This
# option is ignored if log_config_append is set. (string value)
# Deprecated group/name - [DEFAULT]/logfile
#log_file = <None>

# (Optional) The base directory used for relative log_file  paths. This option is ignored if log_config_append is set. (string value)
# Deprecated group/name - [DEFAULT]/logdir
#log_dir = <None>
log_dir = /var/log/gnocchi

# Uses logging handler designed to watch file system. When log file is moved or removed this handler will open a new log file with specified
# path instantaneously. It makes sense only if log_file option is specified and Linux platform is used. This option is ignored if
# log_config_append is set. (boolean value)
#watch_log_file = false

# Use syslog for logging. Existing syslog format is DEPRECATED and will be changed later to honor RFC5424. This option is ignored if
# log_config_append is set. (boolean value)
#use_syslog = false
use_syslog = {{ gnocchi_syslog_use }}

# Syslog facility to receive log lines. This option is ignored if log_config_append is set. (string value)
#syslog_log_facility = LOG_USER

# Log output to standard error. This option is ignored if log_config_append is set. (boolean value)
#use_stderr = true
use_stderr = false

# Format string to use for log messages with context. (string value)
#logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s

# Format string to use for log messages when context is undefined. (string value)
#logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s

# Additional data to append to log message when logging level for the message is DEBUG. (string value)
#logging_debug_format_suffix = %(funcName)s %(pathname)s:%(lineno)d

# Prefix each line of exception output with this format. (string value)
#logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d ERROR %(name)s %(instance)s

# Defines the format string for %(user_identity)s that is used in logging_context_format_string. (string value)
#logging_user_identity_format = %(user)s %(tenant)s %(domain)s %(user_domain)s %(project_domain)s

# List of package logging levels in logger=LEVEL pairs. This option is ignored if log_config_append is set. (list value)
#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,requests.packages.urllib3.util.retry=WARN,urllib3.util.retry=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN,taskflow=WARN,keystoneauth=WARN,oslo.cache=INFO,dogpile.core.dogpile=INFO

# Enables or disables publication of error events. (boolean value)
#publish_errors = false

# The format for an instance that is passed with the log message. (string value)
#instance_format = "[instance: %(uuid)s] "

# The format for an instance UUID that is passed with the log message. (string value)
#instance_uuid_format = "[instance: %(uuid)s] "

# Enables or disables fatal status of deprecations. (boolean value)
#fatal_deprecations = false


[api]

#
# From gnocchi
#

# Path to API Paste configuration. (string value)
#paste_config = api-paste.ini

# The port for the Gnocchi API server. (port value)
# Minimum value: 0
# Maximum value: 65535
#port = 8041

# The listen IP for the Gnocchi API server. (string value)
#host = 0.0.0.0
host = 127.0.0.1

# Toggle Pecan Debug Middleware. (boolean value)
#pecan_debug = false

# Number of workers for Gnocchi API server. By default the available number of CPU is used. (integer value)
# Minimum value: 1
#workers = <None>
workers = {{ gnocchi_api_workers }}

# The maximum number of items returned in a single response from a collection resource (integer value)
#max_limit = 1000


[archive_policy]

#
# From gnocchi
#

# Default aggregation methods to use in created archive policies (list value)
#default_aggregation_methods = mean,min,max,sum,std,median,count,95pct


[cors]

#
# From oslo.middleware
#

# Indicate whether this resource may be shared with the domain received in the requests "origin" header. (list value)
#allowed_origin = <None>

# Indicate that the actual request can include user credentials (boolean value)
#allow_credentials = true

# Indicate which headers are safe to expose to the API. Defaults to HTTP Simple Headers. (list value)
#expose_headers = Content-Type,Cache-Control,Content-Language,Expires,Last-Modified,Pragma

# Maximum cache age of CORS preflight requests. (integer value)
#max_age = 3600

# Indicate which methods can be used during the actual request. (list value)
#allow_methods = GET,POST,PUT,DELETE,OPTIONS

# Indicate which header field names may be used during the actual request. (list value)
#allow_headers = Content-Type,Cache-Control,Content-Language,Expires,Last-Modified,Pragma


[cors.subdomain]

#
# From oslo.middleware
#

# Indicate whether this resource may be shared with the domain received in the requests "origin" header. (list value)
#allowed_origin = <None>

# Indicate that the actual request can include user credentials (boolean value)
#allow_credentials = true

# Indicate which headers are safe to expose to the API. Defaults to HTTP Simple Headers. (list value)
#expose_headers = Content-Type,Cache-Control,Content-Language,Expires,Last-Modified,Pragma

# Maximum cache age of CORS preflight requests. (integer value)
#max_age = 3600

# Indicate which methods can be used during the actual request. (list value)
#allow_methods = GET,POST,PUT,DELETE,OPTIONS

# Indicate which header field names may be used during the actual request. (list value)
#allow_headers = Content-Type,Cache-Control,Content-Language,Expires,Last-Modified,Pragma


[database]

#
# From oslo.db
#

# The file name to use with SQLite. (string value)
# Deprecated group/name - [DEFAULT]/sqlite_db
#sqlite_db = oslo.sqlite

# If True, SQLite uses synchronous mode. (boolean value)
# Deprecated group/name - [DEFAULT]/sqlite_synchronous
#sqlite_synchronous = true

# The back end to use for the database. (string value)
# Deprecated group/name - [DEFAULT]/db_backend
#backend = sqlalchemy

# The SQLAlchemy connection string to use to connect to the database. (string value)
# Deprecated group/name - [DEFAULT]/sql_connection
# Deprecated group/name - [DATABASE]/sql_connection
# Deprecated group/name - [sql]/connection
#connection = <None>
connection = mysql+pymysql://{{ gnocchi_db_user }}:{{ gnocchi_db_password }}@{{ gnocchi_mysql_server }}/{{ gnocchi_db }}?charset=utf8

# The SQLAlchemy connection string to use to connect to the slave database. (string value)
#slave_connection = <None>

# The SQL mode to be used for MySQL sessions. This option, including the default, overrides any server-set SQL mode. To use whatever SQL
# mode is set by the server configuration, set this to no value. Example: mysql_sql_mode= (string value)
#mysql_sql_mode = TRADITIONAL

# Timeout before idle SQL connections are reaped. (integer value)
# Deprecated group/name - [DEFAULT]/sql_idle_timeout
# Deprecated group/name - [DATABASE]/sql_idle_timeout
# Deprecated group/name - [sql]/idle_timeout
#idle_timeout = 3600

# Minimum number of SQL connections to keep open in a pool. (integer value)
# Deprecated group/name - [DEFAULT]/sql_min_pool_size
# Deprecated group/name - [DATABASE]/sql_min_pool_size
#min_pool_size = 1

# Maximum number of SQL connections to keep open in a pool. (integer value)
# Deprecated group/name - [DEFAULT]/sql_max_pool_size
# Deprecated group/name - [DATABASE]/sql_max_pool_size
#max_pool_size = <None>

# Maximum number of database connection retries during startup. Set to -1 to specify an infinite retry count. (integer value)
# Deprecated group/name - [DEFAULT]/sql_max_retries
# Deprecated group/name - [DATABASE]/sql_max_retries
#max_retries = 10
max_retries = -1

# Interval between retries of opening a SQL connection. (integer value)
# Deprecated group/name - [DEFAULT]/sql_retry_interval
# Deprecated group/name - [DATABASE]/reconnect_interval
#retry_interval = 10

# If set, use this value for max_overflow with SQLAlchemy. (integer value)
# Deprecated group/name - [DEFAULT]/sql_max_overflow
# Deprecated group/name - [DATABASE]/sqlalchemy_max_overflow
#max_overflow = 50

# Verbosity of SQL debugging information: 0=None, 100=Everything. (integer value)
# Deprecated group/name - [DEFAULT]/sql_connection_debug
#connection_debug = 0

# Add Python stack traces to SQL as comment strings. (boolean value)
# Deprecated group/name - [DEFAULT]/sql_connection_trace
#connection_trace = false

# If set, use this value for pool_timeout with SQLAlchemy. (integer value)
# Deprecated group/name - [DATABASE]/sqlalchemy_pool_timeout
#pool_timeout = <None>

# Enable the experimental use of database reconnect on connection lost. (boolean value)
#use_db_reconnect = false

# Seconds between retries of a database transaction. (integer value)
#db_retry_interval = 1

# If True, increases the interval between retries of a database operation up to db_max_retry_interval. (boolean value)
#db_inc_retry_interval = true

# If db_inc_retry_interval is set, the maximum seconds between retries of a database operation. (integer value)
#db_max_retry_interval = 10

# Maximum retries in case of connection error or deadlock error before error is raised. Set to -1 to specify an infinite retry count.
# (integer value)
#db_max_retries = 20


[indexer]

#
# From gnocchi
#

# Indexer driver to use (string value)
#url = sqlite:////var/lib/gnocchi/gnocchidb
url = mysql+pymysql://{{ gnocchi_db_user }}:{{ gnocchi_db_password }}@{{ gnocchi_mysql_server }}/{{ gnocchi_db }}?charset=utf8


[keystone_authtoken]

auth_type = password
signing_dir = /var/lib/gnocchi/cache/api
auth_uri = {{ keystone_proto }}://{{ keystone_internal_address }}:5000
auth_url = {{ keystone_proto }}://{{ keystone_internal_address }}:35357
region_name = {{ keystone_region_name }}
user_domain_name = {{ gnocchi_domain_name }}
username = {{ gnocchi_admin_user }}
password = {{ gnocchi_admin_password }}
project_domain_name = {{ gnocchi_project_domain_name }}
project_name = {{ gnocchi_project_name }}
{% if SSLCACertificateFile != '' %}
cafile = {{ SSLCACertificateFile }}
{% endif %}
insecure = {{ ssl_insecure }}

memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host].ip.mgmt }}:11211{% if not loop.last %},{% endif %}{% endfor %}

token_cache_time = 300
revocation_cache_time = 60

# if your memcached server is shared, use these settings to avoid cache poisoning
memcache_security_strategy = ENCRYPT
memcache_secret_key = {{ memcache_secret_key }}

[metricd]

#
# From gnocchi
#

# Number of workers for Gnocchi metric daemons. By default the available number of CPU is used. (integer value)
# Minimum value: 1
#workers = <None>
workers = {{ gnocchi_metricd_workers }}

[oslo_middleware]

#
# From oslo.middleware
#

# The maximum body size for each  request, in bytes. (integer value)
# Deprecated group/name - [DEFAULT]/osapi_max_request_body_size
# Deprecated group/name - [DEFAULT]/max_request_body_size
#max_request_body_size = 114688

# The HTTP Header that will be used to determine what the original request protocol scheme was, even if it was hidden by an SSL termination
# proxy. (string value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
#secure_proxy_ssl_header = X-Forwarded-Proto


[oslo_policy]

#
# From oslo.policy
#

# The JSON file that defines policies. (string value)
# Deprecated group/name - [DEFAULT]/policy_file
#policy_file = policy.json

# Default rule. Enforced when a requested rule is not found. (string value)
# Deprecated group/name - [DEFAULT]/policy_default_rule
#policy_default_rule = default

# Directories where policy configuration files are stored. They can be relative to any directory in the search path defined by the
# config_dir option, or absolute paths. The file defined by policy_file must exist for these directories to be searched.  Missing or empty
# directories are ignored. (multi valued)
# Deprecated group/name - [DEFAULT]/policy_dirs
#policy_dirs = policy.d


[statsd]

#
# From gnocchi
#

# The listen IP for statsd (string value)
#host = 0.0.0.0

# The port for statsd (port value)
# Minimum value: 0
# Maximum value: 65535
#port = 8125

# Resource UUID to use to identify statsd in Gnocchi (unknown value)
#resource_id = <None>

# User ID to use to identify statsd in Gnocchi (string value)
#user_id = <None>

# Project ID to use to identify statsd in Gnocchi (string value)
#project_id = <None>

# Archive policy name to use when creating metrics (string value)
#archive_policy_name = <None>

# Delay between flushes (floating point value)
#flush_delay = 10


[storage]

#
# From gnocchi
#

# Number of workers to run during adding new measures for pre-aggregation needs. (integer value)
#aggregation_workers_number = <None>

# Coordination driver URL (string value)
#coordination_url = <None>
{% if groups['zookeeper'] | count > 0 %}
coordination_url = kazoo://{% for host in groups['zookeeper'] %}{{ hostvars[host].ip.mgmt }}:2181{% if not loop.last %},{% endif %}{% endfor %}
{% else %}
coordination_url = mysql://{{ gnocchi_db_user }}:{{ gnocchi_db_password }}@{{ gnocchi_mysql_server }}/{{ gnocchi_db }}?charset=utf8
{% endif %}

# Storage driver to use (string value)
#driver = file
driver = {{ gnocchi_backend }}

# How many seconds to wait between new metric measure processing (integer value)
#metric_processing_delay = 5

# How many seconds to wait between metric ingestion reporting (integer value)
#metric_reporting_delay = 10

# Ceph pool name to use. (string value)
#ceph_pool = gnocchi
ceph_pool = {{ gnocchi_ceph_pool }}

# Ceph username (ie: admin without "client." prefix). (string value)
#ceph_username = <None>
ceph_username = {{ gnocchi_ceph_user }}

# Ceph keyring path. (string value)
#ceph_keyring = <None>
{% if gnocchi_backend == 'ceph' %}
ceph_keyring = /etc/ceph/{{ ceph_cluster_name }}.client.gnocchi.keyring
{% endif %}

# Ceph configuration file. (string value)
#ceph_conffile = /etc/ceph/ceph.conf
ceph_conffile = /etc/ceph/{{ ceph_cluster_name }}.conf

# Path used to store gnocchi data files. (string value)
#file_basepath = /var/lib/gnocchi

# Path used to store Gnocchi temporary files. (string value)
#file_basepath_tmp = ${file_basepath}/tmp

# Swift authentication version to user. (string value)
#swift_auth_version = 1

# Swift pre-auth URL. (string value)
#swift_preauthurl = <None>

# Swift auth URL. (string value)
#swift_authurl = http://localhost:8080/auth/v1.0

# Swift token to user to authenticate. (string value)
#swift_preauthtoken = <None>

# Swift user. (string value)
#swift_user = admin:admin

# Swift key/password. (string value)
#swift_key = admin

# Swift tenant name, only used in v2 auth. (string value)
#swift_tenant_name = <None>

# Prefix to namespace metric containers. (string value)
#swift_container_prefix = gnocchi

# Connection timeout in seconds. (integer value)
# Minimum value: 0
#swift_timeout = 300

# InfluxDB host (string value)
#influxdb_host = localhost

# InfluxDB port (port value)
# Minimum value: 0
# Maximum value: 65535
#influxdb_port = 8086

# InfluxDB username (string value)
#influxdb_username = root

# InfluxDB password (string value)
#influxdb_password = <None>

# InfluxDB database (string value)
#influxdb_database = gnocchi

# InfluxDB ingests data in asynchroneous ways. Set to True to wait data are ingested. (boolean value)
#influxdb_block_until_data_ingested = false
